# -*- encoding : utf-8 -*-
class CreateBorrowRules < ActiveRecord::Migration
  def change
    create_table :borrow_rules do |t|
      t.integer :role_id
      t.integer :max_book
      t.integer :borrow_time
      t.integer :extended_time
      t.integer :punish_money
      
      t.timestamps
    end
    
    add_index :borrow_rules, :role_id
    
    add_foreign_key(:borrow_rules, :roles, column: 'role_id')
  end
end
